<?php
if (! defined('InTBak')) {
    exit();
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>选择数据库</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
<script>
function DoDrop(dbname)
{
	var ok;
	ok=confirm("确认要删除此数据库?");
	if(ok)
	{
		self.location.href='process.php?action=DropDb&mydbname='+dbname;
	}
}
</script>
</head>

<body>
	<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
		<tr>
			<td>位置：备份数据 -&gt; <a href="change_db.php">选择数据库</a></td>
		</tr>
		<tr>
			<td height="25"><div align="center">
					备份步骤：<font color="#FF0000">选择数据库</font> -&gt; 选择要备份的表 -&gt; 开始备份
					-&gt; 完成
				</div></td>
		</tr>
	</table>
	<br>
	<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
		<tr bgcolor="#555">
			<td width="56%" height="25" bgcolor="#555">
				<div align="center">
					<strong><font color="#FFFFFF">数据库名</font></strong>
				</div>
			</td>
			<td width="44%" height="25">
				<div align="center">
					<strong><font color="#FFFFFF">备份</font></strong>
				</div>
			</td>
		</tr>
<?php
$i = 0;
while (!!$r = $dblink->fetch($sql)) {
    $i ++;
    if ($i % 2 == 0) {
        $bgcolor = "#DBEAF5";
    } else {
        $bgcolor = "#ffffff";
    }
?>
		<tr bgcolor="<?php echo $bgcolor;?>">
			<td height="25">
				<div align="center"><?php echo $r[0]?></div>
			</td>
			<td height="25">
				<div align="center">
					<input type="button" name="Submit" value="备份数据"
						onclick="self.location.href='change_table.php?mydbname=<?php echo $r[0]?>';">
					&nbsp;&nbsp;&nbsp;<input type="button" name="Submit" value="执行SQL"
						onclick="self.location.href='do_sql.php?mydbname=<?php echo $r[0]?>';">
					&nbsp;&nbsp;&nbsp;<input type="button" name="Submit3" value="删除数据库"
						onclick="javascript:DoDrop('<?php echo $r[0]?>')">
				</div>
			</td>
		</tr>
<?php
}
?>
		<tr>
			<td height="25" colspan="2">
				<form name="form1" method="post" action="process.php">
					<table width="100%" border="0" align="center" cellpadding="3"
						cellspacing="1" bgcolor="#555">
						<tr>
							<td height="25">
								<strong>
									<font color="#FFFFFF">建立数据库 <input name="action" type="hidden" id="action" value="CreateDb"></font>
								</strong>
							</td>
						</tr>
						<tr>
							<td bgcolor="#FFFFFF">数据库名： <input name="mydbname" type="text" id="mydbname">
								<select name="mydbchar" id="mydbchar">
									<option value="">默认编码</option> <?php echo ReturnDbCharList('');?>
								</select>
								<input type="submit" name="Submit2" value="建立">
							</td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
	</table>
</body>
</html>